// 导入需要的config和request
import confing from '../config/config.js';
import request from '../util/request.js';


// 申明请求对象
const qcIndexRequst = {
    // dict请求的基本url
    BASE_URL : confing.QC_URL + "/index",
   /**
     * 遍历数据
    */
    // 请求的API
    list(page = 1,limit = 10,index,callbcak){
        // url
        let url = this.BASE_URL + "/list?page=" + page + "&limit=" + limit;
        if(index){
            if(index.indexCode){
                url += "&indexCode=" + index.indexCode;
            }
            if(index.indexName){
                url += "&indexName=" + index.indexName;
            }
            if(index.indexType){
                url += "&indexType=" + index.indexType;
            }
        }
        // 发送请求
        request.get(url,callbcak);
    }
}

// 将dictRequest暴漏出去
export default qcIndexRequst;